﻿<#macro page pageset link containerId="pageDiv" pageSize=10 maxShowPage=10>
    <div id="${containerId}" class="yellow">
   		<#if pageset.totalPage lt 2>
   			<!--
   			<span class="disabled">上一页</span> 
   			<#if pageset.totalPage == 1>
   				<span class="disabled">1</span> 
   			</#if>
   			<span class="disabled">下一页</span> 
   			-->
   		<#else>
   			<#if pageset.hasPrev >
   				<a href="${link}(${pageset.pageNo-1},${pageSize});">上一页</a>
   			<#else>
   				<span class="disabled">上一页</span> 
   			</#if>
   			<#if pageset.totalPage gt maxShowPage>
   				<#if pageset.pageNo gt 6>
   					<a href="${link}(1,${pageSize});">1</a>
   					<a href="${link}(2,${pageSize});">2</a>
   					...
   				</#if>
   				<#list pageset.startPage .. pageset.endPage as no>
	   				<#if no == pageset.pageNo>
			   			<span class="current">${no}</span>
			   		<#else>
			   			<a href="${link}(${no},${pageSize});">${no}</a>
			   		</#if>
	   			</#list>
	   			<#if pageset.endPage lt pageset.totalPage-1>
	   				<#if pageset.endPage lt pageset.totalPage-2>
	   					<#if pageset.totalPage gt pageset.endPage>
		   					...
		   				</#if>
	   				</#if>
	   				<a href="${link}(${pageset.totalPage-1},${pageSize});">${pageset.totalPage-1}</a> 			
	   				<a href="${link}(${pageset.totalPage},${pageSize});">${pageset.totalPage}</a> 
	   			<#else>
	   				<#if pageset.endPage == pageset.totalPage-1>
	   					<a href="${link}(${pageset.totalPage},${pageSize});">${pageset.totalPage}</a> 
	   				</#if>
   				</#if>
   				
   			<#else>
   				<#list 1 .. pageset.totalPage as no>
   					<#if no == pageset.pageNo>
   					<span class="current">${no}</span>
   					<#else>
   					<a href="${link}(${no},${pageSize});">${no}</a>
   					</#if>
   				</#list>
   			</#if>
   			<#if pageset.hasNext>
   				<a href="${link}(${pageset.pageNo+1},${pageSize});">下一页</a>
   			<#else>
   				<span class="disabled">下一页</span>
   			</#if>
   		</#if>
    </div>
</#macro>
